﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace ProgNetAppBlocks.Base
{
    public partial class ProgNetForm : XtraForm//, ICustomTypeDescriptor
    {
        public static bool ForceClose
        {
            get;
            set;
        }

        public ProgNetForm()
        {
            InitializeComponent();
        }

        #region ICustomTypeDescriptor Members

        public virtual AttributeCollection GetAttributes()
        {
            return TypeDescriptor.GetAttributes(this, true);
        }

        public virtual string GetClassName()
        {
            return TypeDescriptor.GetClassName(this, true);
        }

        public virtual string GetComponentName()
        {
            return TypeDescriptor.GetComponentName(this, true);
        }

        public virtual TypeConverter GetConverter()
        {
            return TypeDescriptor.GetConverter(this, true);
        }

        public virtual EventDescriptor GetDefaultEvent()
        {

            return TypeDescriptor.GetDefaultEvent(this, true);
        }

        public virtual PropertyDescriptor GetDefaultProperty()
        {

            return TypeDescriptor.GetDefaultProperty(this, true);
        }

        public virtual object GetEditor(Type editorBaseType)
        {
            return TypeDescriptor.GetEditor(this, editorBaseType, true);
        }

        public virtual EventDescriptorCollection GetEvents(Attribute[] attributes)
        {
            return GetEvents();
        }

        public virtual EventDescriptorCollection GetEvents()
        {
            return ProgNetComponents.Design.EventInfoDescriptor.GetEvents(this);
        }

        public virtual PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            return GetProperties();
        }

        public virtual PropertyDescriptorCollection GetProperties()
        {
            return ProgNetComponents.Design.PropertyInfoDescriptor.GetProperties(this);
        }

        public virtual object GetPropertyOwner(PropertyDescriptor pd)
        {
            return this;
        }

        #endregion

    }
}
